Set x {
    x.shape = Circle {
        strokeWidth : 0
    }

    x.text = Text {
        string : x.label
        -- fontSize: "50pt"
        w : 30.0
        h : 30.0
    }

    x.labelFn = ensure contains(x.shape, x.text)
    x.minSizeFn = ensure minSize(x.shape)
    x.maxSizeFn = ensure maxSize(x.shape)
    x.labelPosFn = encourage sameCenter(x.text, x.shape)
    LOCAL.layering  = x.shape below x.text
}

Set x; Set y {
}

Set x; Set y
where IsSubset(x, y) {
    x.containFn = ensure contains(y.shape, x.shape, 5.0)
    x.sizeFn    = ensure smallerThan(x.shape, y.shape)
    x.outsideFn = ensure outsideOf(y.text, x.shape)
    -- LOCAL.layering  = x.shape above y.shape
    -- LOCAL.layering1  = y.text below x.shape
}

Set x; Set y
where NotIntersecting(x, y) {
    LOCAL.notIntersectFn = ensure disjoint(x.shape, y.shape)
}

Set x; Set y
where Intersect(x, y) {
    LOCAL.overlapFn = ensure overlapping(x.shape, y.shape)
    LOCAL.labelFn1  = ensure outsideOf(y.text, x.shape)
    LOCAL.labelFn2  = ensure outsideOf(x.text, y.shape)
}

Point p {
    p.offset = 15.0
    p.shape = Circle {
        strokeWidth : 0
        color : rgba(0.0, 0.0, 0.0, 1.0)
        r : 3.0
    }

    p.text = Text {
        string : p.label
        x : p.shape.x + p.offset
        y : p.shape.y + p.offset
        -- fontSize: "30pt"
        w : 30.0
        h : 30.0
    }

    p.textLayering = p.text above p.shape
}

Point p
with Set A
where PointIn(A, p) {
    p.containsFn = ensure contains(A.shape, p.shape, 0.3 * A.shape.r)
    p.layering = p.shape above A.shape
}

Point p
with Set A
where Not(PointIn(A, p)) {
    p.notContainsFn = ensure disjoint(A.shape, p.shape)
}
